<?php

namespace app\models\cacheModel\base;

use Yii;
use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/**
 * This is the cache model class for table "{{%admin_role}}".
 *
 * @property string $id 编号
 * @property string $name 名称
 * @property string $content 描述
 * @property int $update_time 操作时间
 * @property int $status 状态
 * @property array $auth 角色的权限
 */
class AdminRole extends Base
{

    /**
     * 表名
     * @return string
     */
    public static function keyPrefix()
    {
        return Yii::$app->db->tablePrefix . 'admin_role';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['update_time', 'status'], 'integer'],
            [['auth'], 'safe'],
            [['id'], 'string', 'max' => 32],
            [['name'], 'string', 'max' => 100],
            [['content'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '编号',
            'name' => '名称',
            'content' => '描述',
            'update_time' => '操作时间',
            'status' => '状态',
            'auth' => '角色的权限',
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributes()
    {
        return [
            'id',
            'name',
            'content',
            'update_time',
            'status',
            'auth',
        ];
    }
}
